package xuegao.study.mall.admin.feign;

import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import xuegao.study.mall.common.api.CommonResult;
import xuegao.study.mall.common.model.ums.UmsResourceCategory;

import java.util.List;

@FeignClient(contextId = "resourceCategory", name = "study-rbac-service", path = "/rbac/resourceCategory")
public interface UmsResourceCategoryClient {

    @ApiOperation("查询所有资源分类")
    @GetMapping("/listAll")
    CommonResult<List<UmsResourceCategory>> listMenu();

    @PostMapping("/add")
    CommonResult<Integer> add(@RequestBody UmsResourceCategory category);

    @PostMapping("/update/{id}")
    CommonResult<Integer> update(@PathVariable("id") Long id, @RequestBody UmsResourceCategory category);

    @DeleteMapping("/delete/{id}")
    CommonResult<Integer> delete(@PathVariable("id") Long id);
}
